<div class="mainTop" style="background-color:#EFEFEF;">
	<h3>选择来源数据表：</h3>
	<div class="input_wrap" id="cubedic" onclick="showMenu('#cubedic' , 'source')" >
		<img src="/assets/images/imgIco-101.png" height="16"> <input
			id="cubedic_input" type="text" value="<#if db??>${db.name}</#if>" class="txt_1 txt"
			onclick="showMenu('#cubedic' , 'source')" readOnly="readOnly"
			style="width:200px;border: 1px solid #09f;"> <a
			href="javascript:showMenu('#cubedic' , 'source')" id="cubelist"><i
			class="selectIco"></i> </a>
		 <input type="hidden" id="cubedic_val" name="source" data-name='' data-db=''/>
	</div>

	<h3> 选择目标数据表：</h3>
	<div class="input_wrap" id="sourcedic" onclick="showMenu('#sourcedic' , 'target')">
		<img src="/assets/images/imgIco-101.png" height="16"> <input
			id="sourcedic_input" type="text" value="<#if db??>${db.name}</#if>" class="txt_1 txt"
			onclick="showMenu('#sourcedic' , 'target')" readOnly="readOnly"
			style="width:200px;border: 1px solid #09f;"> <a
			href="javascript:showMenu('#sourcedic' , 'target')" id="cubelist"><i
			class="selectIco"></i> </a>
		<input type="hidden" name="target" id='sourcedic_val' data-name='' data-db=''/>
	</div>
</div>
<div class="leftList" style="height:240px;">
	<ul>
		<li class="cur"><i class="imgIco-15"></i><a href="#">数据源</a>
		</li>
	</ul>
</div>
<div class="rightCon" style="width:645px !important;height:240px;overflow-y:auto;">
	<div class="rightList" id="cubeList"><#include "tabledic.html"/></div>
</div>
<script type="text/javascript">
	var selVcl = "" ;
	function onClick(e, treeId, treeNode) {
		var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
		nodes = zTree.getSelectedNodes(),
		v = "";
		nodes.sort(function compare(a,b){return a.id-b.id;});
		for (var i=0, l=nodes.length; i<l; i++) {
			v += nodes[i].name + ",";
		}
		if (v.length > 0 ) v = v.substring(0, v.length-1);
		$(selVcl+"_input").val(treeNode.name);
	}
	function selCurTable(val , name , database){
		$(selVcl+"_val").val(val) ;
		$(selVcl+"_val").attr('data-name' , name) ;
		$(selVcl+"_val").attr('data-db' , database) ;
		$(selVcl+"_input").val($(selVcl+"_input").val()+" --> " + name);
		$('#dataexname').val('从 '+ $('#cubedic_val').attr("data-db") + " --> " + $('#cubedic_val').attr("data-name") +" 迁移到 "+ $('#sourcedic_val').attr("data-db") + " --> " + $('#sourcedic_val').attr("data-name"));
	}
	function showMenu(dic , vType) {
		selVcl = dic ;
		type = vType ;
		$('#dbpanel').attr("data-type",vType);
		var cityObj = $(dic);
		var cityOffset = $(dic).position();
		$("#menuContent").css({left:cityOffset.left+"px", top:(cityOffset.top+25)+"px"}).show();

		$("body").bind("mousedown", onBodyDown);
	}
	function hideMenu() {
		$("#menuContent").hide();
		$("body").unbind("mousedown", onBodyDown);
	}
	function onBodyDown(event) {
		if (!(event.target.id == "menuBtn" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
			hideMenu();
		}
	}

	$(function(){
		/**
		$(".leftList ul li").hover(function(){
			$(this).addClass("cur").siblings("li").removeClass("cur");
		},function(){
			$(this).removeClass("cur");	
		});
		**/
		var lefeHeight=$(".leftList").outerHeight(),rightHeight=$(".rightList").outerHeight();
		if(lefeHeight>rightHeight){
			$(".leftList,.rightList").height(lefeHeight);
		}else{
			$(".leftList,.rightList").height(rightHeight);
		}
		
	});
</script>